package com.medical.app.controller;

import com.medical.app.common.vo.FloorIndexVo;
import com.medical.app.common.vo.HealthyEssayVo;
import com.medical.app.common.vo.HospitalBuildingVo;
import com.medical.app.common.vo.HospitalVo;
import com.medical.app.service.HospitalServerService;
import com.qf.medical.response.ResponseEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @description: some desc
 * @author: LuAn
 * @date: 2024/5/6
 */
@Api("医院导航Api在线文档")
@RestController
@RequestMapping("/hospital/server")
public class HospitalServerController {
    @Resource
    private HospitalServerService hospitalServerService;


    @GetMapping("/hospitals")
    @ApiOperation("展示校区信息")
    public ResponseEntity<List<HospitalVo>> hospitalList(){
        return ResponseEntity.success(hospitalServerService.selectHospitals());
    }

    @GetMapping("/hospital/detail")
    @ApiOperation("展示校区详细信息")
    @ApiImplicitParam(name = "hospitalId",value = "医院Id")
    public ResponseEntity<HospitalVo> hospitalDetail(@NotNull Long hospitalId){
        return ResponseEntity.success(hospitalServerService.selectHospital(hospitalId));
    }

    @GetMapping("/building")
    @ApiOperation("展示楼栋信息")
    @ApiImplicitParam(name = "hospitalId",value = "医院Id")
    public ResponseEntity<List<HospitalBuildingVo>> buildingList(@NotNull Long hospitalId){
        return ResponseEntity.success(hospitalServerService.selectBuildings(hospitalId));
    }

    @GetMapping("/floorIndexs")
    @ApiOperation("展示楼层信息")
    @ApiImplicitParam(name = "hospitalId",value = "医院Id")
    public ResponseEntity<List<FloorIndexVo>> floorIndexs(@NotNull Long hospitalBuildingId){
        return ResponseEntity.success(hospitalServerService.selectFloorIndex(hospitalBuildingId));
    }

    @GetMapping("/healthyEssays")
    @ApiOperation("展示健康百科信息")
    public ResponseEntity<List<HealthyEssayVo>> healthyEssays(){
        return ResponseEntity.success(hospitalServerService.selectHealthyEssays());
    }

    @GetMapping("/healthyEssays/detail")
    @ApiOperation("展示健康百科详细信息")
    @ApiImplicitParam(name = "healthyEssayId",value = "健康百科Id")
    public ResponseEntity<HealthyEssayVo> healthyEssaysDetail(@NotNull Long healthyEssayId){
        return ResponseEntity.success(hospitalServerService.selectHealthyEssay(healthyEssayId));
    }
}
